/**
 * \class ExpressionContext.cpp
 *
 *  Created on: 15 apr 2011
 *      Author: ytc0039
 */

#include "ExpressionContext.h"

ExpressionContext::ExpressionContext(IContext* context): IContextDecorator(context) {


}

ExpressionContext::~ExpressionContext() {

}

bool ExpressionContext::addIdent(const IType & type, const Ident & ident)
{
	bool ret = false;
	// no adding to other contexts.


	return ret;
}



bool ExpressionContext::findType(const Ident& ident,TypeEnum& type)const
{
	bool ret = false;
	if( IContextDecorator::findType(ident,type) )
	{
		ret = true;
	}

	//check this context for the same identifier..should not be here too..

	return ret;
}



bool ExpressionContext::identExists(const Ident & ident) const
{
	bool ret = IContextDecorator::identExists(ident);

	//check this context
	if( !ret )
	{
		ret = false;
	}

	return ret;
}



bool ExpressionContext::removeIdent(const Ident & ident)
{
	bool ret = IContextDecorator::removeIdent(ident);

	if( !ret )
	{
		// remove ident from this context
		ret = false;
	}

	return ret;
}

void ExpressionContext::getAllOfType(TypeEnum type, IContext::TypeList & list) const
{
}




